package com.ssm.curd.controller;

import com.ssm.curd.tools.Result;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * BaseExceptionHandle
 * 异常统一增强处理
 * @author zjl
 * @date 2019/12/2
 */
@RestControllerAdvice
public class BaseExceptionHandle {

    @ExceptionHandler(Exception.class)
    public Result exception(Exception e) {
        e.printStackTrace();
        return Result.error(e.getMessage());
    }
}
